/**
 * 
 */
package com.lxit.ibatis;

import java.io.IOException;
import java.io.Reader;
import java.sql.SQLException;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;
import com.ibatis.sqlmap.client.event.RowHandler;

/**
 * @author shp
 *
 */
public class MyRowHandler implements RowHandler{
	
	@Override
	public void handleRow(Object arg0) {
		Reader reader;
		System.out.println("rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr");
		try {
			reader = Resources.getResourceAsReader("sqlMapConf.xml");
			SqlMapClient sqlMapClient = SqlMapClientBuilder.buildSqlMapClient(reader);
			Person ps = new Person();
			ps.setId(8);
			ps.setName("1105xxxdddxxx");
			sqlMapClient.update("updatePerson", ps);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
	}

}
